Bitfield-packed struct storage writes in mappings (#1976)#2011
Open
Th0rgal wants to merge 5 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # PrintAxioms.lean
Contributor
| \n### CI Failure Hints\n\nFailed jobs: `compiler-audits`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n``` |
# Conflicts: # PrintAxioms.lean
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8d91aa9. Configure here.
# Conflicts: # PrintAxioms.lean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setStructMember/setStructMember2write semantics for bitfield-packed structs stored in mappings, with a nested packed mapping-struct helper for read-modify-write slot updates.writeAddressKeyedMapping2PackedWordSlots_eqand regeneratesPrintAxioms.lean(zero new axioms, 0 sorry'd).DepositInfoword update preserving adjacent fields (Compiler/CompilationModelFeatureTest.lean).Closes #1976.
Test plan
lake build Verity Contracts Compiler PrintAxioms→ "Build completed successfully."make check→ "All checks passed."Note
Medium Risk
Changes contract storage semantics for packed struct writes in mappings across Denote and SourceSemantics; incorrect bit masking or slot resolution would affect verified behavior, though changes mirror existing single-key packed paths and include agreement proofs.
Overview
Extends Denote and SourceSemantics so
setStructMember/setStructMember2can update bitfield-packed fields inside structs stored in mappings, not only full-word members. Packed writes use read-modify-write viapackedWordWriteand revert whenpackedBitsValidfails.Adds
writeAddressKeyedMapping2PackedWordSlotsfor double-nested mapping keys (mirroring the existing single-key packed helper), wires it through all relevantexecStmtpaths, and proveswriteAddressKeyedMapping2PackedWordSlots_eqinDenoteAgreement(registered inPrintAxioms.lean).Adds a
PackedStructMemberDenoteSmoke#evalregression: updating one packed field in a mapping struct word leaves adjacent packed fields unchanged (ERC-4337-styleDepositInfolayout).Reviewed by Cursor Bugbot for commit fa4aef2. Bugbot is set up for automated code reviews on this repo. Configure here.